// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'

import Layout from './components/layout'
import IndexPage from './pages/index'
import DetailPage from './pages/detail'

import AnalysePage from './pages/detail/analyse'
import PublishPage from './pages/detail/publish'
import CountPage from './pages/detail/count'
import ForecastPage from './pages/detail/forecast'

Vue.use(VueRouter)
Vue.use(VueResource)

let router = new VueRouter({
    mode: 'history',
    routes:[
        {
          path: '/',
          component: IndexPage
        },
        {
          path: '/detail',
          redirect:'/detail/count',
          component: DetailPage,
          children:[
            {
              path: 'forecast',
              component: ForecastPage
            },
            {
              path: 'publish',
              component: PublishPage
            },
            {
              path: 'analysis',
              component: AnalysePage
            },
            {
              path: 'count',
              component: CountPage
            }
          ]
        }
    ]
})
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<Layout/>',
  components: { Layout }
})
